import Vue from 'vue'
import App from './App.vue'
import router from './router'

Vue.config.productionTip = false
import { Image as VanImage, Button, Form, Field, NavBar ,Toast} from 'vant';
Vue.use(VanImage);
Vue.use(Button);
Vue.use(Form);
Vue.use(Field);
Vue.use(Toast);
Vue.use(NavBar);
//导入腾讯基础文件获取聊天对象
import '../sdk/sdk/tim-js'

let options = {
  SDKAppID: 1400754395// 接入时需要将0替换为您的云通信应用的 SDKAppID，类型为 Number
};
let tim = TIM.create(options); // SDK 实例通常用 tim 表示
import '../sdk/sdk/lib-generate-test-usersig.min.js'
import genTestUserSig from '../sdk/sdk/GenerateTestUserSig'

export const login = (uname) => {
  let promise = tim.login({ userID: uname, userSig: genTestUserSig(uname).userSig });
  promise.then(function () {
    console.log("登陆成功", '=========================='); // 登录成功
  }).catch(function () {
    console.warn('登陆失败', '============================'); // 登录失败的相关信息
  });
}
console.log(tim);
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
